#include <stdio.h>

#define FUNDLEN 50

struct funds {
    char bank[FUNDLEN];
    double bankfund;
    char save[FUNDLEN];
    double savefund;
};

double sum(const struct funds *); // 参数是一个指针

int main(void) {
    struct funds stan = {
            "Garlic-Melon Bank",
            403218.13,
            "Luck's Savings and Loan",
            8568.4,
    };

    printf("Stan has a totol of $%.2f.\n", sum(&stan));

    return 0;
}

double sum(const struct funds * money)
{
    return (money->bankfund + money->savefund);
}